#!/usr/bin/env python
#coding:utf-8
import pymongo
import json

db= pymongo.MongoClient('127.0.0.1',27017).yao
disease_info = db.disease.find()
temp = []
i = 0
for disease in disease_info:
    res = db.drug.update({"$or":[{'effect':{'$regex':disease['name']}},{'major_cure':{'$regex':disease['name']}}]},
                         {'$addToSet':{"disease":disease['name'],"departments":disease['departments'],"body_part":disease['part']}},
                         multi=True)
    print('现在寻找的是：'+disease['name'] + '。index是第'+ str(i)+'个')
    i = i+1
    print(res)
# count = len(disease_info)
# for z in range(count):
#
